<?

if($_GET["m"])
{
	$modulo = "m={$_GET["m"]}&";
}

$sc02 = new sc02();
$sc03 = new sc03();

$menu    = $sc02->getAll($_SESSION["usuario_grupo"]);
$submenu = $sc03->getAll();

?>

<script type="text/javascript">

function fu_mostra_esconde(div,array,flag)
{
	if ( array != null ) {
		for ( i = 0; array[i]; i++ )
		{
			if ( document.getElementById(array[i]) )
				document.getElementById(array[i]).style.display='none';
		}
		if ( document.getElementById(div) )
			document.getElementById(div).style.display = "block";

		if ( flag == 1 ) {
			//onmouseout
			for ( i = 0; array[i]; i++ )
			{
				if ( document.getElementById(array[i]) )
					document.getElementById(array[i]).style.display='none';
			}
		}
	} else {
		if ( document.getElementById(div) ) {
			if ( document.getElementById(div).style.display == "block" )
				document.getElementById(div).style.display = "none";
			else
				document.getElementById(div).style.display = "block"
			if ( flag == 1 ) {
				//onmouseout
				document.getElementById(div).style.display = "none";
			}
		}
	}
}

</script>

<div id="menu">
	<ul>
	<?
	foreach ($menu as $val)
	{
	?>
		<li class="mn_principal">
			<a href="?<? echo $modulo ?>p=<? echo $val["sc02_link"]; ?>">
				<? echo $val["sc02_menu"]; ?>
			</a>
		</li>
	<?
	}
	?>
	</ul>
</div>